import { lazy } from "react";

import { createBrowserRouter, Navigate } from 'react-router-dom'

const Home = lazy(() => import('../pages/Home/Index'))
const List = lazy(() => import('../pages/List/Index'))
const MainLoaty = lazy(() => import('../pages/MainLoaty/Index'))


export const RouterList = [
    {
        path: '/home/mainloaty',
        element: <MainLoaty />,
        title: '首页'
    },
    {
        path: '/home/list',
        element: <List />,
        title: '数据'
    }
]

const Router = createBrowserRouter([
    {
        path: '/',
        element: <Navigate to={'/home'}></Navigate>
    },
    {
        path: '/home',
        element: <Home />,
        children: RouterList
    }
])

export default Router